package de.guice.desktop;

import com.google.inject.Guice;
import com.google.inject.Injector;

import de.guice.aktenschrank.logiclayer.MessengerService;
import de.guice.aktenschrank.messenger.MessengerModule;

public class ExampleSingleton {

	public static void main(String[] args) {
		Injector injector = Guice.createInjector(new MessengerModule());

		MessengerService messenger = injector
				.getInstance(MessengerService.class);
		messenger.sendNotification("Message 1");

		MessengerService messenger2 = injector
				.getInstance(MessengerService.class);
		messenger2.sendNotification("Message 2");
	}
}
